<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <script>
/*        function add(a,b){
            alert(a+b)
        }
        function sub(a,b){
            alert(a-b)
        }
//        add.call(sub,3,1)
        add.apply(sub,[3,1])*/

/*        function animals(){
            this.name = 'animal'
            this.showName = function () {
                alert(this.name)
            }
        }

        function cat(){
            this.name = 'cat'
        }

        var animal = new animals()
        var cat = new cat()
//        animal.showName.call(cat,',')
        animal.showName.apply(cat,[])*/

//多重继承
function Class10()
{
    this.showSub = function(a,b)
    {
        alert(a-b);
    }
}

function Class11()
{
    this.showAdd = function(a,b)
    {
        alert(a+b);
    }
}

function Class2()
{
    Class10.call(this);
    Class11.call(this);
}
        var c2 = new Class2()
        c2.showSub(1,3)
    </script>
</body>
</html>